package cn.thoughtworks.school.repositories;

import cn.thoughtworks.school.entities.LogicQuiz;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

public interface LogicQuizRepository extends JpaRepository<LogicQuiz, Long>,JpaSpecificationExecutor<LogicQuiz> {

    List<LogicQuiz> findAllByIsAvailableIsTrueAndIdIn(List ids);

    Optional<LogicQuiz> findById(Long id);

    Optional<LogicQuiz> findByIdAndIsAvailableIsTrue(Long quizId);

    List<LogicQuiz> findByIdIn(List<Long> ids);
}
